const path = require("path");
const Htmlwebpackplugin = require("html-webpack-plugin");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const { HotModuleReplacementPlugin } = require("webpack");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const webpack = require('webpack')

module.exports = {
    mode: 'development',
    entry: path.join(__dirname, 'src/main.js'), // 入口文件
    output: {
        filename: "bundle.js",
        path: path.resolve(__dirname, "dist")
    },
    module: {
        rules: [

            {
                test: /\.less$/,
                use: [
                    // "style-loader",
                    MiniCssExtractPlugin.loader,
                    "css-loader",
                    // 'postcss-loader',
                    "less-loader"
                ]
            },

        ]
    },
 
    plugins: [
        new CleanWebpackPlugin(),
        // new HotModuleReplacementPlugin()
    ]
}